package com.test.resumeanalysis.ui.talent.talent_info

import android.view.LayoutInflater
import android.view.ViewGroup
import com.test.resumeanalysis.R
import com.test.resumeanalysis.common.CommonRvAdapter
import com.test.resumeanalysis.common.CommonRvHolder
import com.test.resumeanalysis.data.model.resume.EducationExperience
import com.test.resumeanalysis.databinding.RvWorkEpBinding

class EduAdapter:CommonRvAdapter<EducationExperience,RvWorkEpBinding>() {
    override fun onCreateViewHolder(
        parent: ViewGroup,
        viewType: Int
    ): CommonRvHolder<RvWorkEpBinding> {
        val inflate = RvWorkEpBinding.inflate(LayoutInflater.from(parent.context), parent, false)
        return CommonRvHolder(inflate)
    }

    override fun onBindViewHolder(
        holder: CommonRvHolder<RvWorkEpBinding>,
        position: Int,
        binding: RvWorkEpBinding,
        bean: EducationExperience
    ) {
        holder.binding.imageView4.setImageResource(R.drawable.baseline_school_24)
        holder.binding.tvWorkName.text  = bean.major
        holder.binding.workCompany.text = bean.school_name
        val time = bean.start_time_year+"-"+bean.end_time_year
        holder.binding.workTime.text = time
        holder.binding.workFunction.text = bean.degree
    }

}